import Vue from "vue";
import App from "./App.vue";

Vue.config.productionTip = false;
import Header from "./components/header";
import Footer from "./components/footer";
import TypeNav from "./components/typeNav";
import Pagination from "./components/pagination";
Vue.component(Header.name, Header);
Vue.component(Footer.name, Footer);
Vue.component(TypeNav.name, TypeNav);
Vue.component(Pagination.name, Pagination);

import router from "./router";
import store from "./store";
import "./mock/mockServer";
import "./utils/permission";
import * as API from "@/api";

import { MessageBox, Message } from "element-ui";
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$message = Message;

import VueLazyload from "vue-lazyload";
Vue.use(VueLazyload);
const longzhu = require("./assets/R-C.gif");
const buou = require("./assets/640.gif");
Vue.use(VueLazyload, {
  error: buou,
  loading: longzhu,
});

import "@/utils/validate";

new Vue({
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$ajax = API;
  },
  render: (h) => h(App),
  router,
  store,
}).$mount("#app");
